home *** CD-ROM | disk | FTP | other *** search
- /*************************************************************************
- * ドライブ情報
- *************************************************************************/
-
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <dos.h>
- #include <msdos.cf>
-
- #include <silib.h>
- #include <sipd.h>
- #include <sifs.h>
- #include <sicoltbl.h>
- #include <FS/sysinf.h>
- #include "sdkfs.h"
- #include "sdkfscf.h"
-
- #define MAXDRV (26)
-
- static int flgSet = FALSE;
- static int DrvInf[MAXDRV];
-
- static int is_drv(int drv)
- {
- Registers.AX.R = 0x4409; /* ドライブ検査 */
- Registers.BX.R = drv + 1; /* ドライブ */
- calldos();
- return (FS_chkErr() != NORMAL ? 0 : 1);
- }
-
- /*************************************************************************
- * ドライブ情報の取得
- *************************************************************************/
-
- int FileSel_getDrvinf( FILESEL_T *fs )
- {
- int drv;
-
- if ( !flgSet )
- {
- SYSINF_T sysinf;
-
- for ( drv = 0; drv < MAXDRV; ++drv )
- DrvInf[drv] = FALSE;
- ESR_getSetup( &sysinf );
- for ( drv = 0; drv < 16; ++drv )
- {
- if ( sysinf.drvinf[drv].drvTyp != 0xFF )
- DrvInf[drv] = TRUE;
- }
- DrvInf[(int)'Q'-'A'] = TRUE; /* CD-ROM */
- for ( drv = 0; drv < MAXDRV; ++drv )
- {
- if ( DrvInf[drv] == FALSE )
- {
- if ( is_drv(drv) )
- DrvInf[drv] = TRUE;
- }
- }
- flgSet = TRUE;
- }
-
- return (NORMAL);
- }
-
- /*************************************************************************
- * ドライブ情報の表示
- *************************************************************************/
-
- void FileSel_dspDrv( FILESEL_T *fs )
- {
- int drv;
- LAYER_T *ly = SiScn->layerCrt;
-
- FileSel_getDrvinf( fs );
- MOS_DEC();
- for ( drv = 0; drv < MAXDRV; ++drv )
- {
- int x, y;
- COLOR_T col;
- char tmp[4];
-
- x = fs->frDrv.x1 + (drv % (MAXDRV/2)) * (2+6+2);
- y = fs->frDrv.y1 + (drv/(MAXDRV/2)) * (16);
- SCN_BOXFCON(x,y,x+9,y+15,1,PSET,ly->col.gray,FSCOL_HIL,FSCOL_SHA);
- if ( fs->drv == drv )
- col = C_HRED;
- else if ( DrvInf[drv] )
- col = ly->col.black;
- else
- col = ly->col.white;
- tmp[0] = 'A' + drv;
- tmp[1] = '\0';
- SCN_PUTS(SiFts->ftsSs2,tmp,x+2,y+2,OPAQUE,col,ly->col.gray);
-
- EV_SETBTN1(fs->evDrv,drv, drv, fs, fsEvFunc_chdrv,
- NULL, EVSW_LEFT,x,y,x+9,y+15,1,FSCOL_HIL,FSCOL_SHA);
- }
- MOS_INC();
- }
-